package com.kl.feign.fallback;

import com.kl.domain.FreightDTO;
import com.kl.em.ConstantEnum;
import com.kl.em.Result;
import com.kl.feign.FreightServiceFeign;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

//实现类,放容器,重写方法
//降级
@Component
public class FreightServiceFeignFallback implements FreightServiceFeign {

    @Override
    public Result<List<FreightDTO>> findAll(Integer pageNumber, Integer pageSize) {
        //书写降级逻辑,大多数打印日志
        return Result.build(ConstantEnum.FaillBack);
    }

    @Override
    public Result update(FreightDTO FreightDTO) {
        return Result.build(ConstantEnum.FaillBack);
    }

    @Override
    public Result add(FreightDTO FreightDTO) {
        return Result.build(ConstantEnum.FaillBack);
    }

    @Override
    public Result delete(Integer id) {
        return Result.build(ConstantEnum.FaillBack);
    }

    @Override
    public Result getPrice(Integer id, Integer volume, Integer kg) {
        return Result.build(ConstantEnum.FaillBack);
    }


}
